﻿@model BlogEditModel
@{
    ViewBag.ActiveMenu = "日志";
    ViewBag.Title = Model.Id > 0 ? "编辑日志" : "新建日志";
    Layout = MVC.Shared.Views._Layout;
    @*<script src="~/Scripts/UEditor/ueditor.config.js"></script>
    <script src="~/Scripts/UEditor/ueditor.all.min.js"></script>
    <script src="~/Scripts/UEditor/ueditor.parse.min.js"></script>*@
    @Scripts.Render("~/Scripts/UEditor/Js")
}
<section id="page-breadcrumb">
    <div class="vertical-center sun">
        <div class="container">
            <div class="row">
                <div class="action">
                    <div class="col-sm-12">
                        <h1 class="title">@ViewBag.Title</h1>
                        <p>畅游在书的海洋中...</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<!--/#page-breadcrumb-->
<section id="blog-details" class="padding-top padding-bottom">
    <div class="container">
        <div class="row">
            <div class="col-md-offset-1 col-md-10 col-sm-12">
                <div class="box box-default">
                    @*<div class="box-header with-border">
                            <h3 class="box-title">General Elements</h3>
                        </div>*@<!-- /.box-header -->
                    <div class="box-body">
                        @using (Html.BeginForm(MVC.Blog.Blog.Edit(), FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
                        {
                            <input name="Id" type="hidden">
                            <div class="box-body">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">标题</label>
                                    <div class="col-sm-8">
                                        @Html.TextBoxFor(n => n.Title, new RouteValueDictionary { { "autofocus", "" }, { "placeholder", "请输入日志标题" }, { "class", "form-control" }, { "maxlength", "32" } })
                                        @Html.ValidationMessageFor(n => n.Title)
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">摘要</label>
                                    <div class="col-sm-8">
                                        @Html.TextBoxFor(n => n.Summary, new RouteValueDictionary { { "placeholder", "请输入日志摘要" }, { "class", "form-control" }, { "maxlength", "512" } })
                                        @Html.ValidationMessageFor(n => n.Summary)
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">内容</label>
                                    <div class="col-sm-10">
                                        @Html.TextAreaFor(n => n.Content)
                                        @Html.ValidationMessageFor(n => n.Content)
                                        <script type="text/javascript">
                                            $(function () {
                                                var p = {
                                                    textarea: "Content",
                                                    initialFrameHeight: 400 //初始化编辑器高度,默认320
                                                };
                                                UE.getEditor('Content', p).ready(function () {
                                                    this.setContent('@Html.Raw(Model.Content)');
                                                });
                                            });
                                        </script>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">标题图</label>
                                    <div class="col-sm-10">
                                        @Html.Upload("FeaturedImage", Model.FeaturedImage)
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">基本设置</label>
                                    <div class="col-sm-10">
                                        <div class="checkbox">
                                            <label>
                                                @Html.CheckBoxFor(n => n.IsTop)置顶
                                            </label>
                                        </div>
                                        <div class="checkbox">
                                            <label>
                                                @Html.CheckBoxFor(n => n.IsLocked)开启评论
                                            </label>
                                        </div>
                                        <div class="checkbox">
                                            <label>
                                                @Html.CheckBoxFor(n => n.IsViewAfterComment)仅回复可见
                                            </label>
                                        </div>

                                    </div>
                                </div>
                            </div><!-- /.box-body -->
                            <div class="box-footer">
                                <div class="col-sm-offset-4 col-sm-4">
                                    <button class="btn btn-success btn-lg  btn-block" type="submit" plugin="ajaxSubmit">发布</button>
                                </div><!-- /.box-footer -->
                            </div>
                        }
                    </div><!-- /.box-body -->
                </div>
            </div>
        </div>
    </div>

</section>
